import { v4 as uuid4v } from 'uuid';
// 生成随机串 存储到本地，且每次执行不变换
export const getUUID = () => {
  let uuid_token = localStorage.getItem('UUIDTOKEN')
  // 判断是否原来有串
  if (!uuid_token) {
    // 生成临时身份，并存储
    uuid_token = uuid4v();
    localStorage.setItem('UUIDTOKEN', uuid_token)
  }
  return uuid_token
}